package homework02;

import java.util.Random;

public class Test04{
    public static void main(String[] args) {
    	int[][] arr = {{1,2},{3,4,5,6},{7,8,9,10}};
        int row,col,x,y,temp;
        Random rd = new Random();
        
        col = arr.length;
        for (int i=0;i<col;i++){
        	row = arr[i].length;
        	for(int j=0;j<row;j++){
        		x = rd.nextInt(col);
        		y = rd.nextInt(arr[x].length);
        		temp = arr[i][j];
        		arr[i][j] = arr[x][y];
        		arr[x][y] = temp;
        	}
        }
    	
        for (int i=0;i<col;i++){
        	row = arr[i].length;
        	for(int j=0;j<row;j++){
        		System.out.print(arr[i][j]+" ");
        	}
        	System.out.print("\n");
        }
	}
}
